\(\int \frac {1}{\sqrt {-1+x} x \sqrt {1+x}} \, dx\) [839]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [B] (verified)
   Fricas [A] (verification not implemented)
   Sympy [C] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 18, antiderivative size = 16 \[ \int \frac {1}{\sqrt {-1+x} x \sqrt {1+x}} \, dx=\arctan \left (\sqrt {-1+x} \sqrt {1+x}\right ) \]

[Out]

arctan((-1+x)^(1/2)*(1+x)^(1/2))

Rubi [A] (verified)

Time = 0.00 (sec) , antiderivative size = 16, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.111, Rules used = {94, 209} \[ \int \frac {1}{\sqrt {-1+x} x \sqrt {1+x}} \, dx=\arctan \left (\sqrt {x-1} \sqrt {x+1}\right ) \]

[In]

Int[1/(Sqrt[-1 + x]*x*Sqrt[1 + x]),x]

[Out]

ArcTan[Sqrt[-1 + x]*Sqrt[1 + x]]

Rule 94

Int[1/(Sqrt[(a_.) + (b_.)*(x_)]*Sqrt[(c_.) + (d_.)*(x_)]*((e_.) + (f_.)*(x_))), x_Symbol] :> Dist[b*f, Subst[I
nt[1/(d*(b*e - a*f)^2 + b*f^2*x^2), x], x, Sqrt[a + b*x]*Sqrt[c + d*x]], x] /; FreeQ[{a, b, c, d, e, f}, x] &&
 EqQ[2*b*d*e - f*(b*c + a*d), 0]

Rule 209

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*ArcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rubi steps \begin{align*} \text {integral}& = \text {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\sqrt {-1+x} \sqrt {1+x}\right ) \\ & = \tan ^{-1}\left (\sqrt {-1+x} \sqrt {1+x}\right ) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.03 (sec) , antiderivative size = 18, normalized size of antiderivative = 1.12 \[ \int \frac {1}{\sqrt {-1+x} x \sqrt {1+x}} \, dx=2 \arctan \left (\frac {\sqrt {-1+x}}{\sqrt {1+x}}\right ) \]

[In]

Integrate[1/(Sqrt[-1 + x]*x*Sqrt[1 + x]),x]

[Out]

2*ArcTan[Sqrt[-1 + x]/Sqrt[1 + x]]

Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(27\) vs. \(2(12)=24\).

Time = 1.46 (sec) , antiderivative size = 28, normalized size of antiderivative = 1.75

method result size
default \(-\frac {\sqrt {-1+x}\, \sqrt {1+x}\, \arctan \left (\frac {1}{\sqrt {x^{2}-1}}\right )}{\sqrt {x^{2}-1}}\) \(28\)

[In]

int(1/x/(-1+x)^(1/2)/(1+x)^(1/2),x,method=_RETURNVERBOSE)

[Out]

-(-1+x)^(1/2)*(1+x)^(1/2)/(x^2-1)^(1/2)*arctan(1/(x^2-1)^(1/2))

Fricas [A] (verification not implemented)

none

Time = 0.22 (sec) , antiderivative size = 18, normalized size of antiderivative = 1.12 \[ \int \frac {1}{\sqrt {-1+x} x \sqrt {1+x}} \, dx=2 \, \arctan \left (\sqrt {x + 1} \sqrt {x - 1} - x\right ) \]

[In]

integrate(1/x/(-1+x)^(1/2)/(1+x)^(1/2),x, algorithm="fricas")

[Out]

2*arctan(sqrt(x + 1)*sqrt(x - 1) - x)

Sympy [C] (verification not implemented)

Result contains complex when optimal does not.

Time = 12.79 (sec) , antiderivative size = 56, normalized size of antiderivative = 3.50 \[ \int \frac {1}{\sqrt {-1+x} x \sqrt {1+x}} \, dx=- \frac {{G_{6, 6}^{5, 3}\left (\begin {matrix} \frac {3}{4}, \frac {5}{4}, 1 & 1, 1, \frac {3}{2} \\\frac {1}{2}, \frac {3}{4}, 1, \frac {5}{4}, \frac {3}{2} & 0 \end {matrix} \middle | {\frac {1}{x^{2}}} \right )}}{4 \pi ^{\frac {3}{2}}} + \frac {i {G_{6, 6}^{2, 6}\left (\begin {matrix} 0, \frac {1}{4}, \frac {1}{2}, \frac {3}{4}, 1, 1 & \\\frac {1}{4}, \frac {3}{4} & 0, \frac {1}{2}, \frac {1}{2}, 0 \end {matrix} \middle | {\frac {e^{2 i \pi }}{x^{2}}} \right )}}{4 \pi ^{\frac {3}{2}}} \]

[In]

integrate(1/x/(-1+x)**(1/2)/(1+x)**(1/2),x)

[Out]

-meijerg(((3/4, 5/4, 1), (1, 1, 3/2)), ((1/2, 3/4, 1, 5/4, 3/2), (0,)), x**(-2))/(4*pi**(3/2)) + I*meijerg(((0
, 1/4, 1/2, 3/4, 1, 1), ()), ((1/4, 3/4), (0, 1/2, 1/2, 0)), exp_polar(2*I*pi)/x**2)/(4*pi**(3/2))

Maxima [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 7, normalized size of antiderivative = 0.44 \[ \int \frac {1}{\sqrt {-1+x} x \sqrt {1+x}} \, dx=-\arcsin \left (\frac {1}{{\left | x \right |}}\right ) \]

[In]

integrate(1/x/(-1+x)^(1/2)/(1+x)^(1/2),x, algorithm="maxima")

[Out]

-arcsin(1/abs(x))

Giac [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 20, normalized size of antiderivative = 1.25 \[ \int \frac {1}{\sqrt {-1+x} x \sqrt {1+x}} \, dx=-2 \, \arctan \left (\frac {1}{2} \, {\left (\sqrt {x + 1} - \sqrt {x - 1}\right )}^{2}\right ) \]

[In]

integrate(1/x/(-1+x)^(1/2)/(1+x)^(1/2),x, algorithm="giac")

[Out]

-2*arctan(1/2*(sqrt(x + 1) - sqrt(x - 1))^2)

Mupad [B] (verification not implemented)

Time = 2.26 (sec) , antiderivative size = 49, normalized size of antiderivative = 3.06 \[ \int \frac {1}{\sqrt {-1+x} x \sqrt {1+x}} \, dx=-\ln \left (\frac {{\left (\sqrt {x-1}-\mathrm {i}\right )}^2}{{\left (\sqrt {x+1}-1\right )}^2}+1\right )\,1{}\mathrm {i}+\ln \left (\frac {\sqrt {x-1}-\mathrm {i}}{\sqrt {x+1}-1}\right )\,1{}\mathrm {i} \]

[In]

int(1/(x*(x - 1)^(1/2)*(x + 1)^(1/2)),x)

[Out]

log(((x - 1)^(1/2) - 1i)/((x + 1)^(1/2) - 1))*1i - log(((x - 1)^(1/2) - 1i)^2/((x + 1)^(1/2) - 1)^2 + 1)*1i